|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.objectstyle.cayenne.dba.JdbcPkGenerator
org.objectstyle.cayenne.dba.db2.DB2PkGenerator
public class DB2PkGenerator
PK Generator for IBM DB2 using sequences.
| Field Summary | |
|---|---|
static java.lang.String |
SEQUENCE_PREFIX
|
| Fields inherited from class org.objectstyle.cayenne.dba.JdbcPkGenerator |
|---|
DEFAULT_PK_CACHE_SIZE, NEXT_ID, objDesc, pkCache, pkCacheSize, resultDesc |
| Constructor Summary | |
|---|---|
DB2PkGenerator()
|
|
| Method Summary | |
|---|---|
void |
createAutoPk(DataNode node,
java.util.List dbEntities)
Generates necessary database objects to provide automatic primary key support. |
java.util.List |
createAutoPkStatements(java.util.List dbEntities)
Returns a list of SQL strings needed to generates database objects to provide automatic primary support for the list of entities. |
protected java.lang.String |
createSequenceString(DbEntity ent)
Creates SQL needed for creating a sequence. |
void |
dropAutoPk(DataNode node,
java.util.List dbEntities)
Drops table named "AUTO_PK_SUPPORT" if it exists in the database. |
java.util.List |
dropAutoPkStatements(java.util.List dbEntities)
Returns SQL string needed to drop database objects associated with automatic primary key generation. |
protected java.lang.String |
dropSequenceString(DbEntity ent)
Creates SQL needed for dropping a sequence. |
protected java.util.List |
getExistingSequences(DataNode node)
Returns a List of all existing, accessible sequences. |
protected int |
pkFromDatabase(DataNode node,
DbEntity ent)
Creates a new PK from a sequence returned by
SELECT NEXTVAL FOR sequence_name FROM SYSIBM.SYSDUMMY1
SYSIBM.SYSDUMMY1 corresponds to DUAL in Oracle. |
protected java.lang.String |
sequenceName(DbEntity ent)
Returns the sequence name for a given table name. |
| Methods inherited from class org.objectstyle.cayenne.dba.JdbcPkGenerator |
|---|
autoPkTableExists, binaryPK, dropAutoPkString, generatePkForDbEntity, generatePkForDbEntityString, getPkCacheSize, pkCreateString, pkDeleteString, pkSelectString, pkTableCreateString, pkUpdateString, reset, runUpdate, setPkCacheSize |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String SEQUENCE_PREFIX
| Constructor Detail |
|---|
public DB2PkGenerator()
| Method Detail |
|---|
public void createAutoPk(DataNode node,
java.util.List dbEntities)
throws java.lang.Exception
PkGenerator
createAutoPk in interface PkGeneratorcreateAutoPk in class JdbcPkGeneratornode - node that provides access to a DataSource.dbEntities - a list of entities that require primary key autogeneration
support
java.lang.Exceptionpublic java.util.List createAutoPkStatements(java.util.List dbEntities)
PkGenerator
createAutoPkStatements in interface PkGeneratorcreateAutoPkStatements in class JdbcPkGenerator
public void dropAutoPk(DataNode node,
java.util.List dbEntities)
throws java.lang.Exception
JdbcPkGenerator
dropAutoPk in interface PkGeneratordropAutoPk in class JdbcPkGeneratornode - node that provides access to a DataSource.dbEntities - a list of entities whose primary key autogeneration support
should be dropped.
java.lang.Exceptionpublic java.util.List dropAutoPkStatements(java.util.List dbEntities)
PkGenerator
dropAutoPkStatements in interface PkGeneratordropAutoPkStatements in class JdbcPkGeneratorprotected java.lang.String sequenceName(DbEntity ent)
protected java.lang.String createSequenceString(DbEntity ent)
protected java.lang.String dropSequenceString(DbEntity ent)
protected int pkFromDatabase(DataNode node,
DbEntity ent)
throws java.lang.Exception
SELECT NEXTVAL FOR sequence_name FROM SYSIBM.SYSDUMMY1
SYSIBM.SYSDUMMY1 corresponds to DUAL in Oracle.
pkFromDatabase in class JdbcPkGeneratorjava.lang.Exception
protected java.util.List getExistingSequences(DataNode node)
throws java.sql.SQLException
java.sql.SQLException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||